<!DOCTYPE html>
<html lang="zh">
<head>
    <title>多线程</title>
    <meta charset="utf-8"/>
    <meta name="Description" content=""/>
    <meta name="Author" content="巽秋"/>
    <style type="text/css"></style>
</head>
<body>
<div>
    <span id="hour"></span>:<span id="minute"></span>:<span id="second"></span>
</div>

<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>
    let worker = new Worker('./index.js');
    worker.postMessage(new Date().getTime()+1000000);
    worker.onmessage = function (event) {
        $("#hour").text(event.data.hour);
        $("#minute").text(event.data.minute);
        $("#second").text(event.data.second);
    }
</script>
</body>
</html>